/*
 * @(#)Palette.java	0.1 2002-09-03
 * 
 * Copyleft 2002 Wonseok Shin, Taeksoo Jung
 * Anyone can get benefits from this.
 */
package cs348a.color;

import java.awt.Color;

/**
 * A <code>Palette</code> is a mapping from indices between 0 and 255 to (red, green, 
 * blue) components.
 * 
 * @version	0.1
 * @author		Wonseok Shin, Taeksoo Jung
 * @since		0.1
 */
public interface Palette {
	static final int SIZE = 256;	// indexing size of all palettes
	
	/**
	 * Returns the byte array which maps indices to red components.
	 * 
	 * @return byte[] the byte array
	 */
	byte[] getRedComponents();
	
	/**
	 * Returns the byte array which maps indices to green components.
	 * 
	 * @return byte[]
	 */
	byte[] getGreenComponents();
	
	/**
	 * Returns the byte array which maps indices to blue components.
	 * 
	 * @return byte[]
	 */
	byte[] getBlueComponents();
	
	/**
	 * Returns the red component at the given palette index.
	 * 
	 * @param index the given palette index
	 * @return byte the red component
	 */
	byte getRed(int index);
	
	/**
	 * Returns the green component at the given palette index.
	 * 
	 * @param index the given palette index
	 * @return byte the green component
	 */
	byte getGreen(int index);
	
	/**
	 * Returns the blue component at the given palette index.
	 * 
	 * @param index the given palette index
	 * @return byte the blue component
	 */
	byte getBlue(int index);
	
	/**
	 * Returns the color of the given index.  If the index is smaller than zero or
	 * larger than <code>Palette.SIZE - 1</code>, it will be cut off.
	 * 
	 * @param index the given index
	 * @return Color the color
	 */
	Color getColor(int index);
}
